// $ANTLR 3.2 Sep 23, 2009 12:02:23 /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g 2010-02-01 23:29:17

package com.googlecode.bestpaper;

import org.apache.commons.lang.StringUtils;
import com.googlecode.bestpaper.output.pdf.book.PDFBook;
import com.googlecode.bestpaper.output.pdf.book.PDFChapter;
import com.googlecode.bestpaper.output.pdf.book.PDFParagraph;
import com.googlecode.bestpaper.output.pdf.book.PDFSection;
import com.googlecode.bestpaper.output.pdf.table.PDFCell;
import com.googlecode.bestpaper.output.pdf.table.PDFTable;
import com.googlecode.bestpaper.output.pdf.link.PDFLink;
import com.googlecode.bestpaper.output.pdf.typeface.PDFBold;
import com.googlecode.bestpaper.output.pdf.typeface.PDFItalic;
import com.googlecode.bestpaper.output.pdf.typeface.PDFStrike;
import com.googlecode.bestpaper.output.pdf.typeface.PDFString;



import org.antlr.runtime.*;
import org.antlr.runtime.tree.*;import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

public class BestpaperEval extends TreeParser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "BOOK", "CHAPTER", "CHAPTER_HEADING", "SECTION", "PARAGRAPH", "LEVEL1", "LEVEL2", "LEVEL3", "LEVEL4", "LEVEL5", "LEVEL6", "ROW", "NEWLINE", "SPACE", "CH", "H1", "H2", "H3", "H4", "H5", "H6", "WORD", "TABLE_BORD"
    };
    public static final int LEVEL4=12;
    public static final int LEVEL5=13;
    public static final int LEVEL6=14;
    public static final int SECTION=7;
    public static final int ROW=15;
    public static final int CHAPTER_HEADING=6;
    public static final int BOOK=4;
    public static final int CHAPTER=5;
    public static final int TABLE_BORD=26;
    public static final int LEVEL1=9;
    public static final int EOF=-1;
    public static final int SPACE=17;
    public static final int LEVEL3=11;
    public static final int LEVEL2=10;
    public static final int WORD=25;
    public static final int NEWLINE=16;
    public static final int PARAGRAPH=8;
    public static final int H6=24;
    public static final int H5=23;
    public static final int CH=18;
    public static final int H4=22;
    public static final int H3=21;
    public static final int H2=20;
    public static final int H1=19;

    // delegates
    // delegators


        public BestpaperEval(TreeNodeStream input) {
            this(input, new RecognizerSharedState());
        }
        public BestpaperEval(TreeNodeStream input, RecognizerSharedState state) {
            super(input, state);
             
        }
        

    public String[] getTokenNames() { return BestpaperEval.tokenNames; }
    public String getGrammarFileName() { return "/Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g"; }


    private final static String BOLD = "*";
    private final static String ITALIC = "_";
    private final static String STRIKE = "~~";
    private final static String LINK_START = "[";
    private final static String LINK_END = "]";

    private PDFTable table = null;
    private int boldPointer = -1;
    private int strikePointer = -1;
    private int italicPointer = -1;
    private int linkPointer = -1;

    private void appendInvalidTypeface(PDFParagraph para, String nowLine){
    	String invalidTypeface = null;
    	if (italicPointer >= 0) {
    		invalidTypeface = ITALIC + nowLine.substring(this.italicPointer);
    		this.italicPointer = -1;
    	} else if(boldPointer >=0) {
    		invalidTypeface = BOLD + nowLine.substring(this.boldPointer);
    		this.boldPointer = -1;
    	} else if(strikePointer >=0) {
    		invalidTypeface = STRIKE + nowLine.substring(this.strikePointer);
    		this.strikePointer = -1;
    	} else if(linkPointer >=0) {
    		invalidTypeface = LINK_START + nowLine.substring(this.linkPointer);
    	}
    	if (invalidTypeface != null) {
    		para.addChild(new PDFString(invalidTypeface));
    	}
    }
    	
    private void appendWord(PDFParagraph para, String nowLine, String word){
    	int nowIndex = nowLine.length();
    	// --- start typeface
    	if(word.startsWith(BOLD)){
    		appendInvalidTypeface(para, nowLine);
    		this.boldPointer = nowIndex + BOLD.length();
    	}			
    	if(word.startsWith(ITALIC)){
    		appendInvalidTypeface(para, nowLine);
    		this.italicPointer = nowIndex + ITALIC.length();
    	}			 
    	if(word.startsWith(STRIKE)){
    		appendInvalidTypeface(para, nowLine);
    		this.strikePointer = nowIndex + STRIKE.length();
    	}
    	if(word.startsWith(LINK_START)){
    		appendInvalidTypeface(para, nowLine);
    		this.linkPointer = nowIndex + LINK_START.length();
    	}
    	// add common string			
    	if (this.boldPointer < 0 && this.italicPointer < 0 && this.strikePointer < 0 && this.linkPointer < 0){
    		para.addChild(new PDFString(word));			
    	}
    	//--- end typeface
    	if (word.equals(BOLD) || word.equals(ITALIC) || word.equals(STRIKE) || word.equals(LINK_START)) {

    	} else {
    		// move line index
    		nowLine = nowLine += word;
    		nowIndex = nowLine.length();	
    		if(word.endsWith(BOLD) && this.boldPointer >= 0) {
    			String bold = nowLine.substring(this.boldPointer, nowIndex - BOLD.length());
    			para.addChild(new PDFBold(bold));
    			this.boldPointer = -1;
    		}
    		if(word.endsWith(ITALIC) && this.italicPointer >= 0) {
    			String italic = nowLine.substring(this.italicPointer, nowIndex - ITALIC.length());
    			para.addChild(new PDFItalic(italic));
    			this.italicPointer = -1;
    		}			 			
    		if(word.endsWith(STRIKE) && this.strikePointer >= 0) {
    			String strike = nowLine.substring(this.strikePointer, nowIndex - STRIKE.length());
    			para.addChild(new PDFStrike(strike));
    			this.strikePointer = -1;
    		}
    		if(word.endsWith(LINK_END) && this.linkPointer >=0) {
    			String link = nowLine.substring(this.linkPointer, nowIndex - LINK_END.length());
    			para.addChild(new PDFLink(link));
    			this.linkPointer = -1;
    		}
    	}	
    }

    private List<PDFSection> sections = new ArrayList<PDFSection>();

    private void appendSection(PDFSection section){
    	sections.add(section);
    }

    private PDFSection searchFather(int childLayer){
    	PDFSection father = null;
    	if(this.sections.size()==0) return father;
    	for(int i = sections.size() - 1; i >=0; i--) {
    		PDFSection section = sections.get(i);
    		if (section.getLayer() < childLayer){
    			father = section;
    			break;
    		}
    	}
    	return father;
    }





    // $ANTLR start "book"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:133:1: book returns [PDFBook book] : ^( BOOK ( chapter[$book] )+ ) ;
    public final PDFBook book() throws RecognitionException {
        PDFBook book = null;


        		book = new PDFBook();
        	
        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:137:2: ( ^( BOOK ( chapter[$book] )+ ) )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:137:4: ^( BOOK ( chapter[$book] )+ )
            {
            match(input,BOOK,FOLLOW_BOOK_in_book55); 

            match(input, Token.DOWN, null); 
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:137:11: ( chapter[$book] )+
            int cnt1=0;
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( (LA1_0==CHAPTER) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:137:11: chapter[$book]
            	    {
            	    pushFollow(FOLLOW_chapter_in_book57);
            	    chapter(book);

            	    state._fsp--;


            	    }
            	    break;

            	default :
            	    if ( cnt1 >= 1 ) break loop1;
                        EarlyExitException eee =
                            new EarlyExitException(1, input);
                        throw eee;
                }
                cnt1++;
            } while (true);


            match(input, Token.UP, null); 

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return book;
    }
    // $ANTLR end "book"


    // $ANTLR start "chapter"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:139:1: chapter[PDFBook book] : ( ^( CHAPTER chapter_heading[chapter] ( content[null, chapter] )? ( section[chapter] )+ ) | ^( CHAPTER chapter_heading[chapter] ( content[null, chapter] )? ) );
    public final void chapter(PDFBook book) throws RecognitionException {

        		PDFChapter chapter = new PDFChapter();
        	
        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:146:2: ( ^( CHAPTER chapter_heading[chapter] ( content[null, chapter] )? ( section[chapter] )+ ) | ^( CHAPTER chapter_heading[chapter] ( content[null, chapter] )? ) )
            int alt5=2;
            alt5 = dfa5.predict(input);
            switch (alt5) {
                case 1 :
                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:147:2: ^( CHAPTER chapter_heading[chapter] ( content[null, chapter] )? ( section[chapter] )+ )
                    {
                    match(input,CHAPTER,FOLLOW_CHAPTER_in_chapter87); 

                    match(input, Token.DOWN, null); 
                    pushFollow(FOLLOW_chapter_heading_in_chapter89);
                    chapter_heading(chapter);

                    state._fsp--;

                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:147:37: ( content[null, chapter] )?
                    int alt2=2;
                    int LA2_0 = input.LA(1);

                    if ( (LA2_0==PARAGRAPH) ) {
                        alt2=1;
                    }
                    switch (alt2) {
                        case 1 :
                            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:147:37: content[null, chapter]
                            {
                            pushFollow(FOLLOW_content_in_chapter92);
                            content(null, chapter);

                            state._fsp--;


                            }
                            break;

                    }

                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:147:61: ( section[chapter] )+
                    int cnt3=0;
                    loop3:
                    do {
                        int alt3=2;
                        int LA3_0 = input.LA(1);

                        if ( (LA3_0==SECTION) ) {
                            alt3=1;
                        }


                        switch (alt3) {
                    	case 1 :
                    	    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:147:61: section[chapter]
                    	    {
                    	    pushFollow(FOLLOW_section_in_chapter96);
                    	    section(chapter);

                    	    state._fsp--;


                    	    }
                    	    break;

                    	default :
                    	    if ( cnt3 >= 1 ) break loop3;
                                EarlyExitException eee =
                                    new EarlyExitException(3, input);
                                throw eee;
                        }
                        cnt3++;
                    } while (true);


                    match(input, Token.UP, null); 

                    }
                    break;
                case 2 :
                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:148:4: ^( CHAPTER chapter_heading[chapter] ( content[null, chapter] )? )
                    {
                    match(input,CHAPTER,FOLLOW_CHAPTER_in_chapter105); 

                    match(input, Token.DOWN, null); 
                    pushFollow(FOLLOW_chapter_heading_in_chapter107);
                    chapter_heading(chapter);

                    state._fsp--;

                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:148:39: ( content[null, chapter] )?
                    int alt4=2;
                    int LA4_0 = input.LA(1);

                    if ( (LA4_0==PARAGRAPH) ) {
                        alt4=1;
                    }
                    switch (alt4) {
                        case 1 :
                            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:148:39: content[null, chapter]
                            {
                            pushFollow(FOLLOW_content_in_chapter110);
                            content(null, chapter);

                            state._fsp--;


                            }
                            break;

                    }


                    match(input, Token.UP, null); 

                    }
                    break;

            }

            		book.addChild(chapter);
            	
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "chapter"


    // $ANTLR start "chapter_heading"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:150:1: chapter_heading[PDFChapter chapter] : ^( CHAPTER_HEADING title ) ;
    public final void chapter_heading(PDFChapter chapter) throws RecognitionException {
        String title1 = null;


        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:151:2: ( ^( CHAPTER_HEADING title ) )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:151:4: ^( CHAPTER_HEADING title )
            {
            match(input,CHAPTER_HEADING,FOLLOW_CHAPTER_HEADING_in_chapter_heading130); 

            match(input, Token.DOWN, null); 
            pushFollow(FOLLOW_title_in_chapter_heading132);
            title1=title();

            state._fsp--;


            match(input, Token.UP, null); 

            		chapter.setTitle(title1);
            	

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "chapter_heading"


    // $ANTLR start "section"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:156:2: section[PDFChapter chapter] : ( ^( SECTION heading[section] content[section, null] ) | ^( SECTION heading[section] ) );
    public final void section(PDFChapter chapter) throws RecognitionException {

        		PDFSection section = new PDFSection();	
        	
        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:170:2: ( ^( SECTION heading[section] content[section, null] ) | ^( SECTION heading[section] ) )
            int alt6=2;
            alt6 = dfa6.predict(input);
            switch (alt6) {
                case 1 :
                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:171:2: ^( SECTION heading[section] content[section, null] )
                    {
                    match(input,SECTION,FOLLOW_SECTION_in_section164); 

                    match(input, Token.DOWN, null); 
                    pushFollow(FOLLOW_heading_in_section166);
                    heading(section);

                    state._fsp--;

                    pushFollow(FOLLOW_content_in_section169);
                    content(section, null);

                    state._fsp--;


                    match(input, Token.UP, null); 

                    }
                    break;
                case 2 :
                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:172:4: ^( SECTION heading[section] )
                    {
                    match(input,SECTION,FOLLOW_SECTION_in_section178); 

                    match(input, Token.DOWN, null); 
                    pushFollow(FOLLOW_heading_in_section180);
                    heading(section);

                    state._fsp--;


                    match(input, Token.UP, null); 

                    }
                    break;

            }

            		int layer = section.getLayer();
            		PDFSection father = this.searchFather(layer);
            		if (father == null) {
            			chapter.addChild(section);			
            		} else {
            			father.addChild(section);
            		}
            		this.appendSection(section);
            	
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "section"


    // $ANTLR start "heading"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:174:1: heading[PDFSection section] : ( heading1 | heading2 | heading3 | heading4 | heading5 | heading6 );
    public final void heading(PDFSection section) throws RecognitionException {
        String heading12 = null;

        String heading23 = null;

        String heading34 = null;

        String heading45 = null;

        String heading56 = null;

        String heading67 = null;


        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:175:5: ( heading1 | heading2 | heading3 | heading4 | heading5 | heading6 )
            int alt7=6;
            switch ( input.LA(1) ) {
            case LEVEL1:
                {
                alt7=1;
                }
                break;
            case LEVEL2:
                {
                alt7=2;
                }
                break;
            case LEVEL3:
                {
                alt7=3;
                }
                break;
            case LEVEL4:
                {
                alt7=4;
                }
                break;
            case LEVEL5:
                {
                alt7=5;
                }
                break;
            case LEVEL6:
                {
                alt7=6;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 7, 0, input);

                throw nvae;
            }

            switch (alt7) {
                case 1 :
                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:176:5: heading1
                    {
                    pushFollow(FOLLOW_heading1_in_heading205);
                    heading12=heading1();

                    state._fsp--;


                        	section.setTitle(heading12);
                        	section.setLayer(1);
                        

                    }
                    break;
                case 2 :
                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:181:7: heading2
                    {
                    pushFollow(FOLLOW_heading2_in_heading221);
                    heading23=heading2();

                    state._fsp--;


                        	section.setTitle(heading23);
                        	section.setLayer(2);
                        

                    }
                    break;
                case 3 :
                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:186:7: heading3
                    {
                    pushFollow(FOLLOW_heading3_in_heading239);
                    heading34=heading3();

                    state._fsp--;


                        	section.setTitle(heading34);
                        	section.setLayer(3);    	
                        

                    }
                    break;
                case 4 :
                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:191:7: heading4
                    {
                    pushFollow(FOLLOW_heading4_in_heading256);
                    heading45=heading4();

                    state._fsp--;


                        	section.setTitle(heading45);
                        	section.setLayer(4);    	
                        

                    }
                    break;
                case 5 :
                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:196:7: heading5
                    {
                    pushFollow(FOLLOW_heading5_in_heading273);
                    heading56=heading5();

                    state._fsp--;


                        	section.setTitle(heading56);
                        	section.setLayer(5);    	
                        

                    }
                    break;
                case 6 :
                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:201:7: heading6
                    {
                    pushFollow(FOLLOW_heading6_in_heading290);
                    heading67=heading6();

                    state._fsp--;


                        	section.setTitle(heading67);
                        	section.setLayer(6);    	
                        

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "heading"


    // $ANTLR start "heading1"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:207:1: heading1 returns [String value] : ^( LEVEL1 title ) ;
    public final String heading1() throws RecognitionException {
        String value = null;

        String title8 = null;


        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:208:5: ( ^( LEVEL1 title ) )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:208:9: ^( LEVEL1 title )
            {
            match(input,LEVEL1,FOLLOW_LEVEL1_in_heading1344); 

            match(input, Token.DOWN, null); 
            pushFollow(FOLLOW_title_in_heading1346);
            title8=title();

            state._fsp--;


            match(input, Token.UP, null); 

                	value = title8;
                

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return value;
    }
    // $ANTLR end "heading1"


    // $ANTLR start "heading2"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:213:1: heading2 returns [String value] : ^( LEVEL2 title ) ;
    public final String heading2() throws RecognitionException {
        String value = null;

        String title9 = null;


        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:214:5: ( ^( LEVEL2 title ) )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:214:9: ^( LEVEL2 title )
            {
            match(input,LEVEL2,FOLLOW_LEVEL2_in_heading2378); 

            match(input, Token.DOWN, null); 
            pushFollow(FOLLOW_title_in_heading2380);
            title9=title();

            state._fsp--;


            match(input, Token.UP, null); 

                	value = title9;
                

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return value;
    }
    // $ANTLR end "heading2"


    // $ANTLR start "heading3"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:219:1: heading3 returns [String value] : ^( LEVEL3 title ) ;
    public final String heading3() throws RecognitionException {
        String value = null;

        String title10 = null;


        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:220:5: ( ^( LEVEL3 title ) )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:220:9: ^( LEVEL3 title )
            {
            match(input,LEVEL3,FOLLOW_LEVEL3_in_heading3412); 

            match(input, Token.DOWN, null); 
            pushFollow(FOLLOW_title_in_heading3414);
            title10=title();

            state._fsp--;


            match(input, Token.UP, null); 

                	value = title10;
                

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return value;
    }
    // $ANTLR end "heading3"


    // $ANTLR start "heading4"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:225:1: heading4 returns [String value] : ^( LEVEL4 title ) ;
    public final String heading4() throws RecognitionException {
        String value = null;

        String title11 = null;


        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:226:5: ( ^( LEVEL4 title ) )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:226:9: ^( LEVEL4 title )
            {
            match(input,LEVEL4,FOLLOW_LEVEL4_in_heading4446); 

            match(input, Token.DOWN, null); 
            pushFollow(FOLLOW_title_in_heading4448);
            title11=title();

            state._fsp--;


            match(input, Token.UP, null); 

                	value = title11;
                

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return value;
    }
    // $ANTLR end "heading4"


    // $ANTLR start "heading5"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:231:1: heading5 returns [String value] : ^( LEVEL5 title ) ;
    public final String heading5() throws RecognitionException {
        String value = null;

        String title12 = null;


        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:232:5: ( ^( LEVEL5 title ) )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:232:9: ^( LEVEL5 title )
            {
            match(input,LEVEL5,FOLLOW_LEVEL5_in_heading5484); 

            match(input, Token.DOWN, null); 
            pushFollow(FOLLOW_title_in_heading5486);
            title12=title();

            state._fsp--;


            match(input, Token.UP, null); 

                	value = title12;
                

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return value;
    }
    // $ANTLR end "heading5"


    // $ANTLR start "heading6"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:237:1: heading6 returns [String value] : ^( LEVEL6 title ) ;
    public final String heading6() throws RecognitionException {
        String value = null;

        String title13 = null;


        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:238:5: ( ^( LEVEL6 title ) )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:238:9: ^( LEVEL6 title )
            {
            match(input,LEVEL6,FOLLOW_LEVEL6_in_heading6522); 

            match(input, Token.DOWN, null); 
            pushFollow(FOLLOW_title_in_heading6524);
            title13=title();

            state._fsp--;


            match(input, Token.UP, null); 

                	value = title13;
                

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return value;
    }
    // $ANTLR end "heading6"


    // $ANTLR start "title"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:243:1: title returns [String value] : line ;
    public final String title() throws RecognitionException {
        String value = null;

        BestpaperEval.line_return line14 = null;


        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:244:5: ( line )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:244:9: line
            {
            pushFollow(FOLLOW_line_in_title563);
            line14=line();

            state._fsp--;


                	value = (line14!=null?line14.b:null).toString();
                

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return value;
    }
    // $ANTLR end "title"


    // $ANTLR start "content"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:249:1: content[PDFSection section, PDFChapter chapter] : ^( PARAGRAPH ( add_seg[section, chapter] )+ ) ;
    public final void content(PDFSection section, PDFChapter chapter) throws RecognitionException {
        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:250:5: ( ^( PARAGRAPH ( add_seg[section, chapter] )+ ) )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:250:9: ^( PARAGRAPH ( add_seg[section, chapter] )+ )
            {
            match(input,PARAGRAPH,FOLLOW_PARAGRAPH_in_content589); 

            match(input, Token.DOWN, null); 
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:250:21: ( add_seg[section, chapter] )+
            int cnt8=0;
            loop8:
            do {
                int alt8=2;
                int LA8_0 = input.LA(1);

                if ( (LA8_0==ROW||LA8_0==WORD) ) {
                    alt8=1;
                }


                switch (alt8) {
            	case 1 :
            	    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:250:21: add_seg[section, chapter]
            	    {
            	    pushFollow(FOLLOW_add_seg_in_content591);
            	    add_seg(section, chapter);

            	    state._fsp--;


            	    }
            	    break;

            	default :
            	    if ( cnt8 >= 1 ) break loop8;
                        EarlyExitException eee =
                            new EarlyExitException(8, input);
                        throw eee;
                }
                cnt8++;
            } while (true);


            match(input, Token.UP, null); 

            		if(this.table != null){
            			if(section != null) {
            				section.addChild(this.table);
            			} else if(chapter != null) {
            				chapter.addChild(this.table);
            			}
            			//trim temp table
            			this.table = null;
            		}	
                

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "content"


    // $ANTLR start "add_seg"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:263:1: add_seg[PDFSection section, PDFChapter chapter] : ( line | ^( ROW ( row[cells] )+ ) );
    public final void add_seg(PDFSection section, PDFChapter chapter) throws RecognitionException {
        BestpaperEval.line_return line15 = null;


        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:264:2: ( line | ^( ROW ( row[cells] )+ ) )
            int alt10=2;
            int LA10_0 = input.LA(1);

            if ( (LA10_0==WORD) ) {
                alt10=1;
            }
            else if ( (LA10_0==ROW) ) {
                alt10=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 10, 0, input);

                throw nvae;
            }
            switch (alt10) {
                case 1 :
                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:264:4: line
                    {
                    pushFollow(FOLLOW_line_in_add_seg614);
                    line15=line();

                    state._fsp--;


                    		if(this.table != null){
                    			if(section != null) {
                    				section.addChild(this.table);
                    			} else if(chapter != null) {
                    				chapter.addChild(this.table);
                    			}
                    			//trim temp table
                    			this.table = null;
                    		}	
                    		PDFParagraph para = (line15!=null?line15.para:null);
                    		if(section != null) {
                    			section.addChild(para);
                    		} else if(chapter != null) {
                    			chapter.addChild(para);
                    		}
                    	

                    }
                    break;
                case 2 :
                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:283:2: ^( ROW ( row[cells] )+ )
                    {

                    		List<PDFParagraph> cells = new ArrayList<PDFParagraph>();
                    	
                    match(input,ROW,FOLLOW_ROW_in_add_seg628); 

                    match(input, Token.DOWN, null); 
                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:286:8: ( row[cells] )+
                    int cnt9=0;
                    loop9:
                    do {
                        int alt9=2;
                        int LA9_0 = input.LA(1);

                        if ( (LA9_0==WORD) ) {
                            alt9=1;
                        }


                        switch (alt9) {
                    	case 1 :
                    	    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:286:8: row[cells]
                    	    {
                    	    pushFollow(FOLLOW_row_in_add_seg630);
                    	    row(cells);

                    	    state._fsp--;


                    	    }
                    	    break;

                    	default :
                    	    if ( cnt9 >= 1 ) break loop9;
                                EarlyExitException eee =
                                    new EarlyExitException(9, input);
                                throw eee;
                        }
                        cnt9++;
                    } while (true);


                    match(input, Token.UP, null); 

                    		//new table if not exist
                    		if(this.table == null){
                    			this.table = new PDFTable(cells.size());
                    		}	
                    		for(PDFParagraph cell : cells){
                    			this.table.addChild(cell);
                    		}	
                    	

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "add_seg"


    // $ANTLR start "row"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:297:1: row[List cells] : line ;
    public final void row(List cells) throws RecognitionException {
        BestpaperEval.line_return line16 = null;


        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:298:2: ( line )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:298:4: line
            {
            pushFollow(FOLLOW_line_in_row647);
            line16=line();

            state._fsp--;


            		cells.add((line16!=null?line16.para:null));
            	

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "row"

    public static class line_return extends TreeRuleReturnScope {
        public StringBuilder b;
        public PDFParagraph para;
    };

    // $ANTLR start "line"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:303:1: line returns [StringBuilder b, PDFParagraph para] : ( word[$b, $para] space[$b, $para] )* word[$b, $para] ;
    public final BestpaperEval.line_return line() throws RecognitionException {
        BestpaperEval.line_return retval = new BestpaperEval.line_return();
        retval.start = input.LT(1);


        		retval.b = new StringBuilder();
        		retval.para = new PDFParagraph();
        	
        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:313:5: ( ( word[$b, $para] space[$b, $para] )* word[$b, $para] )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:313:7: ( word[$b, $para] space[$b, $para] )* word[$b, $para]
            {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:313:7: ( word[$b, $para] space[$b, $para] )*
            loop11:
            do {
                int alt11=2;
                int LA11_0 = input.LA(1);

                if ( (LA11_0==WORD) ) {
                    int LA11_1 = input.LA(2);

                    if ( (LA11_1==SPACE) ) {
                        alt11=1;
                    }


                }


                switch (alt11) {
            	case 1 :
            	    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:313:8: word[$b, $para] space[$b, $para]
            	    {
            	    pushFollow(FOLLOW_word_in_line678);
            	    word(retval.b, retval.para);

            	    state._fsp--;

            	    pushFollow(FOLLOW_space_in_line681);
            	    space(retval.b, retval.para);

            	    state._fsp--;


            	    }
            	    break;

            	default :
            	    break loop11;
                }
            } while (true);

            pushFollow(FOLLOW_word_in_line686);
            word(retval.b, retval.para);

            state._fsp--;


            }


            		String nowLine = retval.b.toString();
            		//--- end typeface
            		this.appendInvalidTypeface(retval.para, nowLine);
            	
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "line"


    // $ANTLR start "word"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:315:1: word[StringBuilder b, PDFParagraph para] : WORD ;
    public final void word(StringBuilder b, PDFParagraph para) throws RecognitionException {
        CommonTree WORD17=null;

        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:316:2: ( WORD )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:316:4: WORD
            {
            WORD17=(CommonTree)match(input,WORD,FOLLOW_WORD_in_word701); 

            		String word = (WORD17!=null?WORD17.getText():null);
            		appendWord(para, b.toString(), word);
            		b.append(word);
            	

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "word"


    // $ANTLR start "space"
    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:323:1: space[StringBuilder b, PDFParagraph para] : SPACE ;
    public final void space(StringBuilder b, PDFParagraph para) throws RecognitionException {
        CommonTree SPACE18=null;

        try {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:324:2: ( SPACE )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/BestpaperEval.g:324:4: SPACE
            {
            SPACE18=(CommonTree)match(input,SPACE,FOLLOW_SPACE_in_space715); 

            		String word = (SPACE18!=null?SPACE18.getText():null);
            		appendWord(para, b.toString(), word);
            		b.append(word);
            	

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "space"

    // Delegated rules


    protected DFA5 dfa5 = new DFA5(this);
    protected DFA6 dfa6 = new DFA6(this);
    static final String DFA5_eotS =
        "\24\uffff";
    static final String DFA5_eofS =
        "\24\uffff";
    static final String DFA5_minS =
        "\1\5\1\2\1\6\1\2\1\31\1\3\1\31\1\3\1\2\2\uffff\1\17\1\3\1\2\1\3"+
        "\2\31\2\3\1\31";
    static final String DFA5_maxS =
        "\1\5\1\2\1\6\1\2\1\31\1\21\1\31\1\10\1\2\2\uffff\2\31\1\2\1\7\5"+
        "\31";
    static final String DFA5_acceptS =
        "\11\uffff\1\1\1\2\11\uffff";
    static final String DFA5_specialS =
        "\24\uffff}>";
    static final String[] DFA5_transitionS = {
            "\1\1",
            "\1\2",
            "\1\3",
            "\1\4",
            "\1\5",
            "\1\7\15\uffff\1\6",
            "\1\5",
            "\1\12\3\uffff\1\11\1\10",
            "\1\13",
            "",
            "",
            "\1\15\11\uffff\1\14",
            "\1\16\13\uffff\1\15\1\uffff\1\17\7\uffff\1\14",
            "\1\20",
            "\1\12\3\uffff\1\11",
            "\1\14",
            "\1\21",
            "\1\22\15\uffff\1\23\7\uffff\1\21",
            "\1\16\13\uffff\1\15\11\uffff\1\14",
            "\1\21"
    };

    static final short[] DFA5_eot = DFA.unpackEncodedString(DFA5_eotS);
    static final short[] DFA5_eof = DFA.unpackEncodedString(DFA5_eofS);
    static final char[] DFA5_min = DFA.unpackEncodedStringToUnsignedChars(DFA5_minS);
    static final char[] DFA5_max = DFA.unpackEncodedStringToUnsignedChars(DFA5_maxS);
    static final short[] DFA5_accept = DFA.unpackEncodedString(DFA5_acceptS);
    static final short[] DFA5_special = DFA.unpackEncodedString(DFA5_specialS);
    static final short[][] DFA5_transition;

    static {
        int numStates = DFA5_transitionS.length;
        DFA5_transition = new short[numStates][];
        for (int i=0; i<numStates; i++) {
            DFA5_transition[i] = DFA.unpackEncodedString(DFA5_transitionS[i]);
        }
    }

    class DFA5 extends DFA {

        public DFA5(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 5;
            this.eot = DFA5_eot;
            this.eof = DFA5_eof;
            this.min = DFA5_min;
            this.max = DFA5_max;
            this.accept = DFA5_accept;
            this.special = DFA5_special;
            this.transition = DFA5_transition;
        }
        public String getDescription() {
            return "139:1: chapter[PDFBook book] : ( ^( CHAPTER chapter_heading[chapter] ( content[null, chapter] )? ( section[chapter] )+ ) | ^( CHAPTER chapter_heading[chapter] ( content[null, chapter] )? ) );";
        }
    }
    static final String DFA6_eotS =
        "\43\uffff";
    static final String DFA6_eofS =
        "\43\uffff";
    static final String DFA6_minS =
        "\1\7\1\2\1\11\6\2\6\31\6\3\1\31\1\3\1\31\1\3\1\31\1\3\1\31\1\3\1"+
        "\31\1\3\1\31\1\3\2\uffff";
    static final String DFA6_maxS =
        "\1\7\1\2\1\16\6\2\6\31\6\21\1\31\1\10\1\31\1\10\1\31\1\10\1\31\1"+
        "\10\1\31\1\10\1\31\1\10\2\uffff";
    static final String DFA6_acceptS =
        "\41\uffff\1\1\1\2";
    static final String DFA6_specialS =
        "\43\uffff}>";
    static final String[] DFA6_transitionS = {
            "\1\1",
            "\1\2",
            "\1\3\1\4\1\5\1\6\1\7\1\10",
            "\1\11",
            "\1\12",
            "\1\13",
            "\1\14",
            "\1\15",
            "\1\16",
            "\1\17",
            "\1\20",
            "\1\21",
            "\1\22",
            "\1\23",
            "\1\24",
            "\1\26\15\uffff\1\25",
            "\1\30\15\uffff\1\27",
            "\1\32\15\uffff\1\31",
            "\1\34\15\uffff\1\33",
            "\1\36\15\uffff\1\35",
            "\1\40\15\uffff\1\37",
            "\1\17",
            "\1\42\4\uffff\1\41",
            "\1\20",
            "\1\42\4\uffff\1\41",
            "\1\21",
            "\1\42\4\uffff\1\41",
            "\1\22",
            "\1\42\4\uffff\1\41",
            "\1\23",
            "\1\42\4\uffff\1\41",
            "\1\24",
            "\1\42\4\uffff\1\41",
            "",
            ""
    };

    static final short[] DFA6_eot = DFA.unpackEncodedString(DFA6_eotS);
    static final short[] DFA6_eof = DFA.unpackEncodedString(DFA6_eofS);
    static final char[] DFA6_min = DFA.unpackEncodedStringToUnsignedChars(DFA6_minS);
    static final char[] DFA6_max = DFA.unpackEncodedStringToUnsignedChars(DFA6_maxS);
    static final short[] DFA6_accept = DFA.unpackEncodedString(DFA6_acceptS);
    static final short[] DFA6_special = DFA.unpackEncodedString(DFA6_specialS);
    static final short[][] DFA6_transition;

    static {
        int numStates = DFA6_transitionS.length;
        DFA6_transition = new short[numStates][];
        for (int i=0; i<numStates; i++) {
            DFA6_transition[i] = DFA.unpackEncodedString(DFA6_transitionS[i]);
        }
    }

    class DFA6 extends DFA {

        public DFA6(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 6;
            this.eot = DFA6_eot;
            this.eof = DFA6_eof;
            this.min = DFA6_min;
            this.max = DFA6_max;
            this.accept = DFA6_accept;
            this.special = DFA6_special;
            this.transition = DFA6_transition;
        }
        public String getDescription() {
            return "156:2: section[PDFChapter chapter] : ( ^( SECTION heading[section] content[section, null] ) | ^( SECTION heading[section] ) );";
        }
    }
 

    public static final BitSet FOLLOW_BOOK_in_book55 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_chapter_in_book57 = new BitSet(new long[]{0x0000000000000028L});
    public static final BitSet FOLLOW_CHAPTER_in_chapter87 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_chapter_heading_in_chapter89 = new BitSet(new long[]{0x0000000000000180L});
    public static final BitSet FOLLOW_content_in_chapter92 = new BitSet(new long[]{0x0000000000000180L});
    public static final BitSet FOLLOW_section_in_chapter96 = new BitSet(new long[]{0x0000000000000188L});
    public static final BitSet FOLLOW_CHAPTER_in_chapter105 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_chapter_heading_in_chapter107 = new BitSet(new long[]{0x0000000000000108L});
    public static final BitSet FOLLOW_content_in_chapter110 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_CHAPTER_HEADING_in_chapter_heading130 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_title_in_chapter_heading132 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_SECTION_in_section164 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_heading_in_section166 = new BitSet(new long[]{0x0000000000000100L});
    public static final BitSet FOLLOW_content_in_section169 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_SECTION_in_section178 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_heading_in_section180 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_heading1_in_heading205 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_heading2_in_heading221 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_heading3_in_heading239 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_heading4_in_heading256 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_heading5_in_heading273 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_heading6_in_heading290 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_LEVEL1_in_heading1344 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_title_in_heading1346 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_LEVEL2_in_heading2378 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_title_in_heading2380 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_LEVEL3_in_heading3412 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_title_in_heading3414 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_LEVEL4_in_heading4446 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_title_in_heading4448 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_LEVEL5_in_heading5484 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_title_in_heading5486 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_LEVEL6_in_heading6522 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_title_in_heading6524 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_line_in_title563 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_PARAGRAPH_in_content589 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_add_seg_in_content591 = new BitSet(new long[]{0x0000000002008008L});
    public static final BitSet FOLLOW_line_in_add_seg614 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ROW_in_add_seg628 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_row_in_add_seg630 = new BitSet(new long[]{0x0000000002000008L});
    public static final BitSet FOLLOW_line_in_row647 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_word_in_line678 = new BitSet(new long[]{0x0000000000020000L});
    public static final BitSet FOLLOW_space_in_line681 = new BitSet(new long[]{0x0000000002000000L});
    public static final BitSet FOLLOW_word_in_line686 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_WORD_in_word701 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_SPACE_in_space715 = new BitSet(new long[]{0x0000000000000002L});

}